﻿using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;

namespace Dilon.Core
{
    /// <summary>
    /// 员工表
    /// </summary>
    [SugarTable("sys_emp", TableDescription = "员工表")]
    public class SysEmp : PrimaryKeyEntity
    {

        /// <summary>
        /// 工号
        /// </summary>
        [SugarColumn(ColumnDescription="工号", IsNullable = true)]
        public string JobNum { get; set; }

        /// <summary>
        /// 机构Id
        /// </summary>
        [SugarColumn(ColumnDescription="机构Id")]
        public long OrgId { get; set; }

        /// <summary>
        /// 机构名称
        /// </summary>
        [SugarColumn(ColumnDescription="机构名称")]
        public string OrgName { get; set; }

        /// <summary>
        /// 多对多（职位）
        /// </summary>
        [SqlSugar.SugarColumn(IsIgnore = true)]
        public ICollection<SysPos> SysPos { get; set; }

        /// <summary>
        /// 多对多中间表（员工-职位）
        /// </summary>
        [SqlSugar.SugarColumn(IsIgnore = true)]
        public List<SysEmpPos> SysEmpPos { get; set; }
    }
}
